<?php


namespace app\xiangji\controller;


use app\Request;
use app\xiangji\BaseController;
use app\xiangji\services\UserWalletService;
use think\App;

class UserWallet extends BaseController
{
    private $userWalletService;

    public function __construct(UserWalletService $service)
    {
        $this->userWalletService = $service;
    }

    public function walletInfo()
    {
        $result = $this->userWalletService->getUserWalletInfo();
        return $this->success($result);
    }

    public function walletLogs(Request $request)
    {
        $result = $this->userWalletService->getUserWalletLogs($request);
        return $this->success($result);
    }

    public function withdraw(Request $request)
    {
        $result = $this->userWalletService->userWithdraw($request->post('amount'));
        return $this->success($result);
    }

    public function userWithdrawList(Request $request)
    {
        $result = $this->userWalletService->userWithdrawList($request);
        return $this->success($result);
    }

    public function lastWithdrawStatus()
    {
        $result = $this->userWalletService->lastWithdrawStatus();
        return $this->success($result);
    }
}
